home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1998 #1 / Amiga Plus 1998 #1.iso / demo-versionen / haage&partner / warpup-warpos / source / tools / showinfo.p < prev    next >
Text File  |  1997-09-24  |  6KB  |  166 lines

  1.                 incdir  include:
  2.                 incdir  lvo:
  3.  
  4. **      '(C) Copyright 1997 Haage & Partner Computer GmbH'
  5. **           All Rights Reserved
  6.  
  7.                 include powerpc/ppcmacros.i
  8.                 include powerpc/powerpc.i
  9.  
  10.                 include powerpc_lib.i
  11.                 include exec_lib.i
  12.                 include dos_lib.i
  13.  
  14.                 STRUCTURE       POWERINFO,0
  15.                 APTR            POWERINFO_CPU
  16.                 ULONG           POWERINFO_PVR
  17.                 ULONG           POWERINFO_CPUCLOCK_U
  18.                 ULONG           POWERINFO_CPUCLOCK_L
  19.                 ULONG           POWERINFO_BUSCLOCK_U
  20.                 ULONG           POWERINFO_BUSCLOCK_L
  21.                 APTR            POWERINFO_ICACHE
  22.                 APTR            POWERINFO_DCACHE
  23.                 APTR            POWERINFO_TABLE
  24.                 ULONG           POWERINFO_TABLESIZE
  25.                 ULONG           POWERINFO_TBU
  26.                 ULONG           POWERINFO_TBL
  27.                 LABEL           POWERINFO_SIZE
  28.  
  29.  
  30.                 xref    _SysBase
  31.                 xref    _DOSBase
  32.                 xref    _PowerPCBase
  33.                 xref    _LinkerDB
  34.                 smalldata
  35.                 executable
  36.                 escapestr
  37.                 vea
  38.                 version 10
  39.  
  40. start
  41.                 prolog  1024
  42.                 pushgpr r29-r31
  43.                 lnk     r29,-POWERINFO_SIZE
  44.                 subi    r29,r29,POWERINFO_SIZE
  45.                 la      r4,PPCInfo_Tags
  46.                 CALLPOWERPC     GetInfo
  47.                 lw      r6,Tag_PVR
  48.                 stw     r6,POWERINFO_PVR(r29)
  49.                 lw      r6,Tag_CPU
  50.                 la      r3,CPU_603
  51.                 bittst  r6,CPUP_603
  52.                 bne     .found
  53.                 la      r3,CPU_604
  54.                 bittst  r6,CPUP_604
  55.                 bne     .found
  56.                 la      r3,CPU_603E
  57.                 bittst  r6,CPUP_603E
  58.                 bne     .found
  59.                 la      r3,CPU_604E
  60.                 bittst  r6,CPUP_604E
  61.                 bne     .found
  62.                 la      r3,CPU_620
  63.                 bittst  r6,CPUP_620
  64.                 bne     .found
  65.                 la      r3,CPU_Unknown
  66. .found
  67.                 stw     r3,POWERINFO_CPU(r29)
  68.                 lw      r6,Tag_BUSCLOCK
  69.                 liw     r4,1000000
  70.                 divwu   r3,r6,r4
  71.                 stw     r3,POWERINFO_BUSCLOCK_U(r29)
  72.                 mullw   r3,r3,r4
  73.                 subf    r3,r3,r6
  74.                 stw     r3,POWERINFO_BUSCLOCK_L(r29)
  75.                 lw      r6,Tag_CPUCLOCK
  76.                 liw     r4,1000000
  77.                 divwu   r3,r6,r4
  78.                 stw     r3,POWERINFO_CPUCLOCK_U(r29)
  79.                 mullw   r3,r3,r4
  80.                 subf    r3,r3,r6
  81.                 stw     r3,POWERINFO_CPUCLOCK_L(r29)
  82.                 lw      r6,Tag_ICACHE
  83.                 la      r3,CACHE_OFF_L
  84.                 bittst  r6,CACHEP_OFF_LOCKED
  85.                 bne     .icachedone
  86.                 la      r3,CACHE_OFF_U
  87.                 bittst  r6,CACHEP_OFF_UNLOCKED
  88.                 bne     .icachedone
  89.                 la      r3,CACHE_ON_L
  90.                 bittst  r6,CACHEP_ON_LOCKED
  91.                 bne     .icachedone
  92.                 la      r3,CACHE_ON_U
  93. .icachedone
  94.                 stw     r3,POWERINFO_ICACHE(r29)
  95.                 lw      r6,Tag_DCACHE
  96.                 la      r3,CACHE_OFF_L
  97.                 bittst  r6,CACHEP_OFF_LOCKED
  98.                 bne     .dcachedone
  99.                 la      r3,CACHE_OFF_U
  100.                 bittst  r6,CACHEP_OFF_UNLOCKED
  101.                 bne     .dcachedone
  102.                 la      r3,CACHE_ON_L
  103.                 bittst  r6,CACHEP_ON_LOCKED
  104.                 bne     .dcachedone
  105.                 la      r3,CACHE_ON_U
  106. .dcachedone
  107.                 stw     r3,POWERINFO_DCACHE(r29)
  108.                 lw      r6,Tag_PAGETABLE
  109.                 stw     r6,POWERINFO_TABLE(r29)
  110.                 lw      r6,Tag_TABLESIZE
  111.                 stw     r6,POWERINFO_TABLESIZE(r29)
  112.                 mftbu   r6
  113.                 mftbl   r3
  114.                 stw     r6,POWERINFO_TBU(r29)
  115.                 stw     r3,POWERINFO_TBL(r29)
  116.                 la      _d1,infotext
  117.                 mr      _d2,r29
  118.                 RUN68K_XL       _DOSBase,VPrintf
  119.                 addi    r29,r29,POWERINFO_SIZE
  120.                 ulnk    r29,-POWERINFO_SIZE
  121.                 popgpr
  122.                 epilog
  123.  
  124.                 section data
  125. infotext        dc.b    "CPU:                   %s   (PVR = %08lx)\n"
  126.                 dc.b    "CPU clock:             %ld.%06ld MHz\n"
  127.                 dc.b    "Bus clock:             %ld.%06ld MHz\n"
  128.                 dc.b    "Instruction Cache:     %s\n"
  129.                 dc.b    "Data Cache:            %s\n"
  130.                 dc.b    "Page table location:   %08lx\n"
  131.                 dc.b    "Page table size:       %ld KBytes\n"
  132.                 dc.b    "Time base content:     %08lx %08lx\n"
  133.                 dc.b    0
  134.  
  135. CPU_603         dc.b    "PPC 603",0
  136. CPU_603E        dc.b    "PPC 603E",0
  137. CPU_604         dc.b    "PPC 604",0
  138. CPU_604E        dc.b    "PPC 604E",0
  139. CPU_620         dc.b    "PPC 620",0
  140. CPU_Unknown     dc.b    "UNKNOWN",0
  141. CACHE_ON_U      dc.b    "ON and UNLOCKED",0
  142. CACHE_OFF_U     dc.b    "OFF and UNLOCKED",0
  143. CACHE_ON_L      dc.b    "ON and LOCKED",0
  144. CACHE_OFF_L     dc.b    "OFF and LOCKED",0
  145.  
  146.                 cnop    0,4
  147. PPCInfo_Tags
  148.                 dc.l    PPCINFO_CPU
  149. Tag_CPU         dc.l    0
  150.                 dc.l    PPCINFO_PVR
  151. Tag_PVR         dc.l    0
  152.                 dc.l    PPCINFO_ICACHE
  153. Tag_ICACHE      dc.l    0
  154.                 dc.l    PPCINFO_DCACHE
  155. Tag_DCACHE      dc.l    0
  156.                 dc.l    PPCINFO_PAGETABLE
  157. Tag_PAGETABLE   dc.l    0
  158.                 dc.l    PPCINFO_TABLESIZE
  159. Tag_TABLESIZE   dc.l    0
  160.                 dc.l    PPCINFO_BUSCLOCK
  161. Tag_BUSCLOCK    dc.l    0
  162.                 dc.l    PPCINFO_CPUCLOCK
  163. Tag_CPUCLOCK    dc.l    0
  164.                 dc.l    0
  165.  
  166.